package com.future.Config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;


    /**
     * 跨域配置
     * @author liyue
     * @date 2019/4/8 13 16
     */
    @Configuration
// @EnableWebMvc
    public class CorsConfig extends WebMvcConfigurationSupport {


        @Override
        public void addResourceHandlers(ResourceHandlerRegistry registry) {
            registry.addResourceHandler("swagger-ui.html")
                    .addResourceLocations("classpath:/META-INF/resources/");

            registry.addResourceHandler("/webjars/**")
                    .addResourceLocations("classpath:/META-INF/resources/webjars/");
            registry.addResourceHandler("/static/**")
                    .addResourceLocations("classpath:/static/");
        }

    }
